package com.guozcc.bootweb.api.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MySimpleJob implements SimpleJob {

    @Override
    public void execute(ShardingContext shardingContext) {
        log.info("调度参数："+shardingContext.getJobParameter()
                +"；调度名称："+shardingContext.getJobName()
                +"；分片总数："+shardingContext.getShardingTotalCount()
                +"；当前分片键："+shardingContext.getShardingItem()
                +"；当前分片值："+shardingContext.getShardingParameter());
    }
}
